<extend name="../Public/base" />
<block name="title"><title>{$TITLE}列表</title></block>
<block name="body">
    <div class="text-c">
        <form method="post" action="{:U('Article/index')}">
            <input type="text" name="keyword" value="{$keyword}" placeholder="{$TITLE}标题" style="width:250px" class="input-text">
            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </form>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a href="javascript:;" onclick="dels('article_id')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
            <a class="btn btn-primary radius" data-title="添加{$TITLE}" data-href="{:U('add')}" onclick="Hui_admin_tab(this)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加文章</a>
        </span>
        <span class="r">共有数据：<strong>{$count}</strong> 条</span> </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
            <tr class="text-c">
                <th width="5%"><input type="checkbox" name="" value=""></th>
                <th width="5%">ID</th>
                <th width="5%">分类</th>
                <th width=30%">标题</th>
                <th width="5%">作者</th>
                <th width="10%">标签</th>
                <th width="5%">置顶</th>
                <th width="5%">点击数</th>
                <th width="15%">发布时间</th>
                <th width="5%">状态</th>
                <th width="10%">操作</th>
            </tr>
            </thead>
            <tbody>
                <foreach name="list" item="info">
                    <tr class="text-c">
                        <td><input type="checkbox" name="article_id[]" value="{$info.article_id}"></td>
                        <td>{$info.article_id}</td>
                        <td>{$cates[$info['cate_id']]['cate_name']}</td>
                        <td>{$info.title}</td>
                        <td>{$info.author}</td>
                        <td>{$info.keywords}</td>
                        <td class="td-status">
                            <eq name='info.is_top' value='1'>
                                <span class="label label-success radius">是</span>
                                <else/>
                                <span class="label radius">否</span>
                            </eq>
                        </td>
                        <td>{$info.click}</td>
                        <td>{$info.create_time|date="Y-m-d H:i:s",###}</td>
                        <td class="td-status">
                            <eq name='info.status' value='1'>
                                <span class="label label-success radius">已发布</span>
                                <else/>
                                <span class="label label-success radius">草稿</span>
                            </eq>
                        </td>
                        <td class="f-14">
                            <eq name='info.status' value='1'>
                                <a  onclick="article_publish_status('{$info.article_id}')" href="javascript:;" title="草稿箱"><i class="Hui-iconfont">&#xe6de;</i></a>
                                <else/>
                                <a  onclick="article_publish_status('{$info.article_id}')" href="javascript:;" title="发布"><i class="Hui-iconfont">&#xe6dc;</i></a>
                            </eq>
                            <a style="text-decoration:none" class="ml-5" data-title="编辑文章" data-href="{:U('edit', array('article_id'=>$info['article_id']))}" onclick="Hui_admin_tab(this)" href="javascript:;"><i class="Hui-iconfont">&#xe6df;</i></a>
                            <a style="text-decoration:none" class="ml-5" onClick="del('{$info.article_id}','article_id')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
                    </tr>
                </foreach>
            </tbody>
        </table>
    </div>
</block>
<block name="js">
<script type="text/javascript">

    //文章发布状态
    function article_publish_status(id){
        action('确认要改变文章发布状态吗？',id,"{:U('changePublish')}",'article_id');
    }

</script>
</block>